<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数学对象</title>
		<script>
			console.log(Math.PI);
			console.log(Math.abs(-10));
			// Math.ceil()的意思就是向上取整
			console.log(Math.ceil(2.3));  // 3
			console.log(Math.ceil(2.6));  // 3
			console.log(Math.ceil(-2.6)); // -2
			console.log(Math.floor(2.3));  // 2
			console.log(Math.floor(2.6));  // 2
			console.log(Math.floor(-2.6)); // -3
			
			var array1 = [1, 3, 2,10];
			
			console.log(Math.max(...array1));
			console.log(Math.max(1, 3, 2,10));
			
			console.log(Math.random());
			
			function getRandomInt(max) {
			  return Math.floor(Math.random() * max);
			}
			
			console.log(getRandomInt(10));
			
			function getRandomArbitrary(min, max) {
			  return Math.random() * (max - min) + min;
			}
			console.log(getRandomArbitrary(5,10));
		</script>
	</head>
	<body>
	</body>
</html>